package com.cloudspace.jindun.rongyun;

import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.support.v4.app.Fragment;

import com.cloudspace.jindun.R;
import com.cloudspace.jindun.activity.xiaoxi.InformActivity;

import java.util.Locale;

import io.rong.imkit.RongExtension;
import io.rong.imkit.plugin.IPluginModule;
import io.rong.imlib.model.Conversation;

/**
 * User: Cloud(32325596@qq.com)
 * Date: 2017-01-16
 * Time: 11:42
 * project: jindunnew
 * Describe 通知
 */
public class MyPlugin implements IPluginModule {
    private Context context;
    private String targetId;

    @Override
    public Drawable obtainDrawable(Context context) {
        return context.getResources().getDrawable(R.drawable.tz);
    }

    @Override
    public String obtainTitle(Context context) {
        return context.getString(R.string.inform);
    }

    @Override
    public void onClick(final Fragment fragment, RongExtension rongExtension) {
        context = fragment.getActivity().getApplicationContext();
        targetId = rongExtension.getTargetId();


        Intent intent=new Intent();
        intent.setClass(context, InformActivity.class);
        intent.putExtra("targetId", targetId);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

        context.startActivity(intent);
    }

    @Override
    public void onActivityResult(int i, int i1, Intent intent) {

    }
}
